import { resetShapeList } from '../event/shape.actions';
import { BaseShape } from '../types/BaseShape';
import { IType, type IShapeProps } from '../types/IShape';

/* 多选 */
export const multipleSelectMode = ref(false);

/* 多选列表 */
export const selectSet = ref(new Set<string>());

/**
 * 注释: 往SET里面添加ID
 *
 * */
export const addIdInSet = (item: IShapeProps) => {
  if (!multipleSelectMode.value) {
    selectSet.value.clear();
  }
  selectSet.value.add(item.id);
  resetShapeList();
};

/* 当前激活的绘图 */
export const currentShape = ref<IShapeProps>(new BaseShape(IType.NULL));
export const resetCurrentShape = () => {
  currentShape.value = new BaseShape(IType.NULL);
};
/* 框选后的容器的样式 */
export const dragBoxConfig = ref({
  left: 0,
  top: 0,
  width: 0,
  height: 0,
  show: false,
});

/* 鼠标方向:true水平,false:垂直 */
export const mouseDirection = ref(false);
export const copySet = ref();
